define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'task.release/index',
        add_url: 'task.release/add',
        edit_url: 'task.release/edit',
        delete_url: 'task.release/delete',
        export_url: 'task.release/export',
        modify_url: 'task.release/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '发布任务ID'},
                    {field: 'title', title: '标题'},
                    // {field: 'release_source', title: '发布来源(1-后台，2-前端，3-其他)'},
                    {field: 'community_name', title: '所属社区'},
                    {field: 'max_count', title: '最大领取数'},
                    {field: 'receive_count', title: '已领次数'},
                    {field: 'category_title', title: '所属分类'},
                    // {field: 'remark', title: '备注', templet: ea.table.text},
                    // {field: 'deal_uid', title: '最后操作人'},
                    // {field: 'is_del', title: '是否删除(0-否，1-是)'},
                    // {field: 'view_count', title: '浏览次数'},
                    // {field: 'create_time', title: '创建时间'},
                    {field: 'release_user_name', title: '发布人'},
                    {field: 'release_time', title: '发布时间'},
                    {field: 'status', title: '发布状态', selectList:{0:'否', 1:'是'}, templet: ea.table.switch},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});